$(function(){
$('.input_sub').click(function(e){
    e.preventDefault()
let username=$('.input_txt').val().trim()
let password=$('.input_pass').val().trim()
let layerid=0
$.ajax({
    type:'post',
    url:'http://localhost:8080/api/v1/admin/user/login',
    data:{
        username,
        password
    },
    beforeSend:function(){
layerid=layer.load()
    },
    complete:function(){
layer.close(layerid)
    },
    success:function(res){
      if(res.token){
          localStorage.setItem('token',res.token)
        location.href='./index.html'
      }
    }
})

})
})